<?php
    /*
     * 格式：
     * {
     *      "type":"1",
     *      "title":"网页标题",
     *      "tenant_id":"",
     *      "url":"",
     *      "content":{
     *          "body":[
     *              {
     *                  "image":"",
     *                  "title":"",
     *                  "desc"
     *              },
     *              {
     *                  "image":"",
     *                  "title":"",
     *                  "desc"
     *              },
     *              {
     *                  "image":"",
     *                  "title":"",
     *                  "desc"
     *              }
     *          ]
     *      }
     * }
     */
?>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="overview &amp; stats" Cache-control="max-age=5"/>
    <meta name="format-detection" content="telephone=no"/>
    @if(isset($data['title']))
        <title>{!! $data['title'] !!}</title>
    @endif
    <!-- <link rel="stylesheet" href="css/public.css"> -->
    <style>
        body{margin:0;background:#f7f7f7}@media only screen and (min-width:1366px){html{font-size:12px}body{width:40%;margin:0 30%}}@media only screen and (max-width:800px){html{font-size:9px}}@media only screen and (min-width:800px){html{font-size:11px}}html{font-family:"Microsoft YaHei", "微软雅黑", "宋体", Arial, sans-serif;user-select:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none}ul{padding:0;margin:0;width:100%}ul li{height:95px;padding:0 15px;background:#fff;margin-bottom:10px;position:relative;list-style:none}.avater{width:100%}.avater img{margin-top:15px;height:auto;width:85px}.title-content{position:absolute;left:110px;right:20px;top:15px}.title{height:28px;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:2em;color:#5eaafe}.content{font-size:1.2em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:18px;color:#888}a{color:#000;text-decoration:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}
    </style>
</head>
<body>
<ul>
    @if(isset($data['content']['body']))
        @foreach($data['content']['body'] as $item)
            @if($item['url'])
                <a href="{!! $item['url'] !!}">
            @endif
                <li>
                    @if(isset($item['image']))
                        <div class="avater"><img src="{!! $item['image'] !!}"></div>
                    @endif
                    <div class="title-content">
                        @if(isset($item['title']))
                        <div class="title">{!! $item['title'] !!}</div>
                         @endif($item['title'])
                        @if(isset($item['desc']))
                            <div class="content">{!! $item['desc'] !!}</div>
                        @endif(isset($item['desc']))
                    </div>
                </li>
            </a>
        @endforeach
    @endif
</ul>
</body>
</html>